package practice;

import java.util.Scanner;

public class MT2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int maxMoney =1000;
        int count =Integer.parseInt(scanner.nextLine()) ;
        String cur = scanner.nextLine();
        String[] s = cur.split(" ");
        for (int i = 1; i < s.length; i++) {
            if(Integer.parseInt(s[i])> Integer.parseInt(s[i-1]))
            {
                int  c = maxMoney / Integer.parseInt(s[i - 1]);
                maxMoney = maxMoney+(c)*(Integer.parseInt(s[i])-Integer.parseInt(s[i-1]));
            }
            if(maxMoney>=1e-6)
            {
               maxMoney = 1000000;
               int min=Integer.MAX_VALUE,max= 0;
                for (int j = i; j < count; j++) {
                   if(Integer.parseInt(s[i])<min)
                   {
                       min = Integer.parseInt(s[i]);
                   }else if(Integer.parseInt(s[i])-min>max)
                   {
                       max = Integer.parseInt(s[i])-min;
                   }
                }
                count = maxMoney/min;
                maxMoney = maxMoney+count*max;

            }
        }
        System.out.println(maxMoney);

    }
}
